Get balance
Path
- URL:
/cb-core/api/v1/get-balance - Method:
POST - Description: Get balance.
Sequences
Request
Request table
| Params | Data Type | Required | Description |
|---|---|---|---|
| request_id | string(50) | Yes | The only code that corresponds to an upload request. Proposed format is as follows: MerchantCode + BK + YYYYMMDD + UniqueId |
| request_time | string(19) | Yes | Time to send request from Merchant, format: YYYY-MM-DD HH:MM:SS |
| merchant_code | string(20) | Yes | The merchant code defined in the Baokim system. This code will be sent to the merchant during integration |
| currency_code | string(20) | No | Currency code (Ex: VND, USD, ...). If you want to check all the balance, send null |
Request Example
{
"request_id": "BK20231106",
"request_time": "2024-11-06 10:15:30",
"merchant_code": "MERCHANT1234",
"currency_code": null
}
Response
Response Table
| Params | Data Type | Required | Description |
|---|---|---|---|
| response_code | int(4) | Yes | Error code from Baokim as per Error Codes Table |
| response_message | string(200) | Yes | Description of the error code from Baokim as per Error Codes Table |
| merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| data | Array of Objects | Yes | List balance |
Data Array Structure (Inside data)
| Params | Data Type | Description |
|---|---|---|
| currency_code | string(20) | Currency code (Ex: VND, USD, ...) |
| available_balance | decimal(18,2) | Available balance |
| holding_balance | decimal(18,2) | Balance includes suspended transactions |
| estimated_balance | decimal(18,2) | Balance includes all of your transactions |
Example JSON Response
{
"response_code": 200,
"response_message": "Success",
"merchant_code": "MERCHANT1234",
"data": [
{
"currency_code": "VND",
"available_balance": 10000000.00,
"holding_balance": 0.00,
"estimated_balance": 12000000.00
},
{
"currency_code": "USD",
"available_balance": 2500.00,
"holding_balance": 0.00,
"estimated_balance": 2500.00
}
]
}
Error Code
| Response Code | Response Message |
|---|---|
| 200 | Success |
| 99 | Pending |
| 11 | Failed |
| 101 | System Error |
| 110 | Merchant Code Invalid |
| 120 | Invalid Signature |
| 422 | Validation Error |